Skip to content

Conversation

@aadamgough
Copy link
Collaborator

Summary

Fixed jira tool output

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Dec 16, 2025 2:11am

@aadamgough aadamgough merged commit 57e6a0b into staging Dec 16, 2025
10 checks passed
@aadamgough aadamgough deleted the fix/tool-output branch December 16, 2025 02:16
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 16, 2025

Greptile Overview

Greptile Summary

This PR updates the Jira tool output schemas to better reflect the actual data structure by removing the redundant wrapper fields (success and output) from the outputs schema definitions and declaring the actual output fields directly.

Key Changes:

  • Removed top-level success field from block outputs schema in apps/sim/blocks/blocks/jira.ts
  • Updated all 22 Jira tool files to declare actual output fields (e.g., ts, issueKey, summary) instead of wrapping them in an output object

Issues Found:

  • Critical mismatch: Many tool implementations still return a success: boolean field inside the output object (e.g., add_comment.ts, write.ts, update.ts, delete_issue.ts, transition_issue.ts, etc.), but this field was removed from the outputs schemas. The TypeScript type definitions in apps/sim/tools/jira/types.ts include these success fields, creating inconsistency between:
    • What the code returns (includes success in output)
    • What the TypeScript types define (includes success in output)
    • What the outputs schema declares (does NOT include success)
  • Tools that correctly don't include success in output: retrieve.ts, search_issues.ts, get_comments.ts, get_worklogs.ts, get_attachments.ts, bulk_read.ts
  • Additional field missing from schema: create_issue_link.ts returns linkId field not declared in outputs schema

Confidence Score: 2/5

  • This PR has critical schema/implementation mismatches that need resolution before merging
  • The outputs schemas were updated but 16 out of 22 tool implementations still return a success field in the output object that's no longer declared in the schema. This creates a mismatch between the schema definitions, TypeScript types, and actual runtime behavior. While the tools may still function, the schema should accurately reflect what's returned.
  • Pay close attention to all tool implementation files that return success in the output object: add_comment.ts, write.ts, update.ts, delete_issue.ts, transition_issue.ts, assign_issue.ts, update_comment.ts, delete_comment.ts, add_worklog.ts, update_worklog.ts, delete_worklog.ts, delete_attachment.ts, create_issue_link.ts, delete_issue_link.ts, add_watcher.ts, remove_watcher.ts

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/tools/jira/add_comment.ts 3/5 Updated outputs schema to remove success/output wrapper, but implementation still returns success field in output object (lines 136, 160) - mismatch between schema and actual return values
apps/sim/tools/jira/write.ts 3/5 Updated outputs schema correctly but implementation returns success field in output (line 106) that's not declared in schema - type definition includes it but schema doesn't
apps/sim/tools/jira/update.ts 3/5 Updated outputs schema but implementation returns undeclared success field in output object (line 113) - creates schema/implementation mismatch
apps/sim/tools/jira/delete_issue.ts 3/5 Updated outputs schema to remove success field, but implementation still returns it in output object (lines 102, 129, 140, 167) - schema doesn't match actual return values
apps/sim/tools/jira/transition_issue.ts 3/5 Updated outputs schema but implementation returns undeclared success field (lines 176, 197) - TypeScript types include success but outputs schema doesn't
apps/sim/tools/jira/update_comment.ts 3/5 Updated outputs schema but implementation returns undeclared success field (lines 143, 167) - schema and implementation mismatch
apps/sim/tools/jira/update_worklog.ts 3/5 Updated outputs schema but implementation returns success field (lines 162, 185) not declared in schema
apps/sim/tools/jira/create_issue_link.ts 3/5 Updated outputs schema but implementation returns undeclared success and linkId fields - partial schema mismatch

Sequence Diagram

sequenceDiagram
    participant Client
    participant JiraTool
    participant Schema
    participant TypeScript
    participant JiraAPI

    Client->>JiraTool: Execute Jira operation
    JiraTool->>Schema: Validate params against schema
    Schema-->>JiraTool: Params valid
    JiraTool->>JiraAPI: Make API request
    JiraAPI-->>JiraTool: API response
    JiraTool->>JiraTool: transformResponse()
    Note over JiraTool: Returns {success: true, output: {...}}
    Note over JiraTool: output contains: ts, issueKey, etc.
    Note over JiraTool: ALSO contains: success field (not in schema)
    JiraTool->>TypeScript: Type check response
    Note over TypeScript: Type includes success in output ✓
    JiraTool->>Schema: Validate output against outputs schema
    Note over Schema: Schema does NOT include success field ✗
    Note over Schema,TypeScript: MISMATCH: Implementation and types<br/>include success, but schema doesn't
    JiraTool-->>Client: Return response
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (17)

  1. apps/sim/tools/jira/add_comment.ts, line 136 (link)

    logic: success field is returned in output but not declared in the outputs schema (line 166-170). TypeScript type JiraAddCommentResponse includes it, creating a mismatch between schema, types, and implementation.

  2. apps/sim/tools/jira/add_comment.ts, line 160 (link)

    logic: success field is returned in output but not declared in outputs schema (line 166-170).

  3. apps/sim/tools/jira/write.ts, line 106 (link)

    logic: success field in output object is not declared in outputs schema (lines 133-137). The TypeScript type includes it but the schema doesn't.

  4. apps/sim/tools/jira/update.ts, line 113 (link)

    logic: success field returned but not in outputs schema (lines 132-136). Mismatch between implementation and schema.

  5. apps/sim/tools/jira/transition_issue.ts, line 176 (link)

    logic: success field returned but not in outputs schema. Also occurs at line 197.

  6. apps/sim/tools/jira/update_comment.ts, line 143 (link)

    logic: success not in outputs schema. Also at line 167.

  7. apps/sim/tools/jira/update_worklog.ts, line 162 (link)

    logic: success field not in outputs schema. Also at line 185.

  8. apps/sim/tools/jira/delete_comment.ts, line 111 (link)

    logic: success not declared in outputs schema. Also at line 132.

  9. apps/sim/tools/jira/delete_attachment.ts, line 104 (link)

    logic: success not in outputs schema. Also at line 124.

  10. apps/sim/tools/jira/delete_worklog.ts, line 111 (link)

    logic: success field not in outputs schema.

  11. apps/sim/tools/jira/remove_watcher.ts, line 111 (link)

    logic: success not declared in outputs schema. Also at line 132.

  12. apps/sim/tools/jira/create_issue_link.ts, line 197-198 (link)

    logic: linkId and success returned but not in outputs schema (lines 175-181). TypeScript type includes both.

  13. apps/sim/tools/jira/delete_issue_link.ts, line 102 (link)

    logic: success field not in outputs schema.

  14. apps/sim/tools/jira/add_watcher.ts, line 111 (link)

    logic: success not in outputs schema.

  15. apps/sim/tools/jira/assign_issue.ts, line 102 (link)

    logic: success field returned but not declared in outputs schema.

  16. apps/sim/tools/jira/add_worklog.ts, line 142 (link)

    logic: success field not declared in outputs schema.

  17. apps/sim/tools/jira/delete_issue.ts, line 102 (link)

    logic: success field returned in output but not declared in outputs schema. Remove this field from the output object to match the schema.

23 files reviewed, 17 comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants